dash(F10): D-series version-gate standardization (D1+D2+D5) - #147
Merged
Conversation
successor_switch_allowed() now consumes the PPLNS-weighted desired-version tally (get_desired_version_weights) via the exact rational new_ver_weight*100 >= total_weight*60, matching the canonical v36-native shape (F10 685669e share_check step 2; p2pool data.py 1396-1414). Replaces the prior plain-count floor gate (have >= floor(total*60/100)), which diverged at non-round totals — 4/7 cleared under floor, rejects under the canonical rational form. The plain count (get_desired_version_counts) is retained unchanged for AutoRatchet + the VOTING tail guard (D4). The 95% activation gate stays signal-only; should_punish_version is NOT reintroduced (D3). Scaffolding-only: no live DASH share_check caller; zero merged-consensus risk. test_dash_conformance 23/23 green on Linux x86_64.
classify_switch() + switch_accepted() fold the canonical v36-native share_check step-2 transition logic into the DASH scaffolding. D1 wired only the 60% upgrade threshold (successor_switch_allowed); the canonical shape (F10 share_check.hpp step 2; p2pool-dash data.py Share.check) classifies a predecessor->desired transition into five cases, of which the threshold gate is the body of just one: Same desired == prev -> allow (continuation) SuccessorGated desired == prev + 1 -> allow IFF the 60% weighted gate clears PredecessorAllowed desired == prev - 1 -> allow (downgrade-by-one rollback) InvalidJump |delta| > 1 -> reject (no version skipping) NoHistory +1 switch, < CHAIN_LENGTH ancestors -> reject (no support window) no-history applies ONLY to the +1 successor -- the one transition needing the support window; Same/Predecessor need none, an InvalidJump rejects on structure regardless. switch_accepted() defers SuccessorGated to the D1 gate and decides the rest structurally, mirroring F10 step 2 exactly. Additive scaffolding: classify_switch / switch_accepted / SwitchClass are NEW; the D1 successor_switch_allowed and v36_active functions are untouched. KAT pins all five classification cases + the full switch_accepted decision table, and cross-checks the SuccessorGated body against the live successor_switch_allowed so the classifier can never diverge from the D1 gate it composes with. No live DASH share_check caller -- zero merged-consensus risk. test_dash_conformance 24/24 green on Linux x86_64 (SwitchClassifier5CaseKat added; real nonzero-count run from build/).
…x::work get_desired_version_weights() recomputed target_to_average_attempts( bits_to_target(m_bits)) live per share. Consume the cached per-share ShareIndex::work instead (set at add() to the identical value, share_chain.hpp:227), standardizing on the shared F10 work accessor and removing recompute-drift risk. Behavior-identical in production where a shares bits are immutable once it enters the chain. Test harness: SyntheticChain::add now sets the final bits/version BEFORE chain.add() so the cached index work reflects them, mirroring the production invariant; add_versioned no longer mutates m_bits post-add. KAT expected values unchanged; test_dash_conformance 24/24 green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DASH F10 version-gate standardization. Single-coin (DASH/X11 only), no cross-coin surface.
D3/D4 are aligned-invariants, no-code. Local ctest 24/24 green on Linux x86_64. All commits GPG-signed. Stacked on master @3e8ba8ef (#138).
Note: the cached-vs-live work equivalence holds in production; a synthetic harness that mutates m_bits post-add can diverge — not a production path.